package setup

import (
	"context"
	"gitee.com/alex_li/ad-analysis/cmd/keywords-contribution/process"
	"gitee.com/alex_li/ad-analysis/internal/job"
)

func Setup(ctx context.Context) (err error) {
	process.HasCsvTitle = true

	process.EmptyFilter = true
	process.NumberFilter = true
	process.SkipWordFilter = true

	go func() {
		job.Run(job.WithContext(ctx), job.WithHandler(func(ctx context.Context) bool {
			proc := process.New(ctx)
			proc.CalcKeywordsContribution()
			return true // go on
		}))
	}()
	return
}
